import java.util.Scanner;

/**
 * 输入一个int型的正整数，计算出该int型数据在内存中存储时1的个数。
 * Created by JiaJia on 2019/6/19 0019.
 */
public class HuaWei015 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            int input=scanner.nextInt();
            String str=Integer.toBinaryString(input);
            int num=0;
            for (int i = 0; i <str.length() ; i++) {
                if (str.charAt(i)=='1'){
                    num++;
                }
            }
            System.out.println(num);
        }
        scanner.close();
    }
}